#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#define N 40
int ReadScore(int name[],int score[]);
int FindMax(int score[],int k);
int main()
{
	int i = 0;
	int n = 0;
	int m = 0;
	int name[N] = { 0 };
	int score[N] = { 0 };
	printf("put score\n");
	n = ReadScore(name,score);
	m =FindMax(score,n);
	for (i = 0; i < n; i++)
	{
		if (m == score[i])
		{
			m = i;
		}
	}
	printf("max = %d,name = %d\n", score[m], name[m]);
	return 0;
}
int ReadScore(int name[],int score[])
{
	int i = -1;
	do
	{
		i++;
		scanf("%d", &score[i]);
		name[i] = i+1;
	} while (score[i] > 0);
	return i;
}
int FindMax(int score[],int k)
{
	int i = 0;
	int temp = 0;
	int max = 0;
	for (i = 0; i < k; i++)
	{
		if (score[i] > max)
		{
			max = score[i];
		}
	}
	return max;
}
